﻿using System;

namespace MyLibrary.ThreeLayer.DataAccess.Attributes
{
    /// <summary>
    /// 表连接属性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class JoinAttribute : Attribute
    {
        public readonly JoinType _JoinType;
        public readonly Type _JoinTarget;

        /// <summary>
        /// 表连接属性 
        /// </summary>
        /// <param name="t">连接对象</param>
        public JoinAttribute(Type t)
        {
            this._JoinType = JoinType.InnerJoin;
            this._JoinTarget = t;
        }

        /// <summary>
        /// 表连接属性
        /// </summary>
        /// <param name="t">连接对象</param>
        /// <param name="type">连接类型</param>
        public JoinAttribute(Type t, JoinType type)
        {
            this._JoinType = type;
            this._JoinTarget = t;
        }
    }
}
